<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<head>
<title>login</title>
</head>
<body>
<?php 
if(isset($_POST['submitted']))
{
	//form submit code here
	$user=Admin::login($_POST['userid'],$_POST['userpass']);
	if($user instanceof Admin)
	{
		$_SESSION['user']=$user;
		echo "login success ! return <a href=\"./index.html\" >home</a>";
	}
	else
	{
		echo "login fail ! return <a href=\"./Login.html\" >Login</a>";
	}
} 
else
{ 
?>
<form method="POST" action="<?php echo $_SERVER['PHP_SELF'] ?>">
<label for="userid" >userid</label><input type="text" name="userid" /><br>
<label for="userpass" >userpass</label><input type="password" name="userpass" /><br>
<input type="submit" name="submitted" value="login"></form>
<?php
}
?>
</body>
